    <!-- 导航栏 -->
    <nav class="navbar navbar-expand-lg navbar-dark bg-primary sticky-top">
        <div class="container">
            <a class="navbar-brand" href="/">
                <?php
                if (empty($webinfo_row['logo'])) {
                    echo $webinfo_row['webname'];
                } else { ?>
                    <img src="<?php echo $webinfo_row['logo']; ?>" width="200px" />
                <?php }

                ?>
            </a>
            <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
                <span class="navbar-toggler-icon"></span>
            </button>
            <?php
            $mainMenuQuery = "SELECT * FROM article_menu WHERE nav != 0";
            $mainMenuResult = mysqli_query($link, $mainMenuQuery); ?>

            <div class="collapse navbar-collapse" id="navbarNav">
                <ul class="navbar-nav ms-auto">
                    <?php while ($mainItem = mysqli_fetch_assoc($mainMenuResult)) {
                        $currentMenuId = $_GET['wbtreeid'];
                        $isActive = ($mainItem['wbtreeid'] == $currentMenuId) ? 'active' : '';
                        $articlelink = ($webinfo_row['static'] == 1)
                            ? "/list/list-{$mainItem['wbtreeid']}.htm"
                            : "list.php?wbtreeid={$mainItem['wbtreeid']}"; ?>
                        <li class="nav-item">
                            <a class="nav-link <?php echo $isActive; ?>" href="<?php echo $articlelink; ?>">
                                <?php echo htmlspecialchars($mainItem['menu']); ?>
                            </a>
                        </li>
                    <?php } ?>
                </ul>
            </div>

        </div>
    </nav>